import Vue from 'vue'
import App from './App.vue'
import Bus from '../utils/event.js'
import { focus } from '../src/directive/directive.js'

Vue.config.productionTip = false

// 全局添加事件总线
Vue.prototype.$bus = Bus

// Vue.mixin(mix)

Vue.config.optionMergeStrategies.myOptions = function (toVal, fromVal) {
  
}

// 添加一个全局自定义指令
Vue.directive('focus',focus)

Vue.component('test',{
  template:`
  <div @click="componentBtn" id='test' style="display:flex;">
    <slot name="footer" :name="name"></slot>
    <slot :text='text'>default slot</slot>
  </div>
  `,
  data() {
    return {
      text:'test 标签',
      name: 'masuen'
    }
  },
  mounted() {
    
  },
  methods: {
    componentBtn() {
      this.$emit('test','testEvent')
    }
  }
});

new Vue({
  data: {
    foo :'foo'
  },
  render: h => h(App),
}).$mount('#app')